UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QJBx3wPp6jNNHgd/173ZSlHau5+op3pHRMLlUbC0lz0=' 
WHERE 
  key_id = '00a38a2adb3aff82601241719707fa4a54bddb2cdce06fac7e71f16092c3cbc4' 
  AND (
    token = 'QJBx3wPp6jNNHgd/173ZSlHau5+op3pHRMLlUbC0lz0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036