UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'm4fpLMsRDiHlMJ3EwnJri1o/vih8Mi0a7yn7q7OkIgY=' 
WHERE 
  key_id = '5f0aff6ea358b40a87e9a44c4c7520b28097f0d76fab21a2a67e13172a4d24f6' 
  AND (
    token = 'm4fpLMsRDiHlMJ3EwnJri1o/vih8Mi0a7yn7q7OkIgY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028