UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kcoqHdu9+0B2yFjBNoJkUIiIQ2wOhTCuE0umTaVLWRE=' 
WHERE 
  key_id = '7503c09f2752e412880b5d1ce53f1ad5c7da558b2183f8225343b1abe4b8c06d' 
  AND (
    token = 'kcoqHdu9+0B2yFjBNoJkUIiIQ2wOhTCuE0umTaVLWRE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042