UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LM2N6F8SodYd3x42ZQ8Desci2cpbFgzvTTWQTS4q2tM=' 
WHERE 
  key_id = '7b387f26991abbffe49e82c53a45d8ac8d834a98d1f3ddb6e0122c0538ff7616' 
  AND (
    token = 'LM2N6F8SodYd3x42ZQ8Desci2cpbFgzvTTWQTS4q2tM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051