UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eJNfa1viYqsGEDBCq/H5mVPzRBFEyLTIaN+Ip9mHpYk=' 
WHERE 
  key_id = 'e287a6df5a7c230cb1bcb8ac583d4b446188472a242c14bd4b32bc2b60d04f23' 
  AND (
    token = 'eJNfa1viYqsGEDBCq/H5mVPzRBFEyLTIaN+Ip9mHpYk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019