UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ccCfzAlZdz3pGA13tJjTsQY8js7G7qePADjuDix8eek=' 
WHERE 
  key_id = 'bb128c0ddf489cad1db325b3c4a40abf39381427050d48bdf085d8004d8c3a75' 
  AND (
    token = 'ccCfzAlZdz3pGA13tJjTsQY8js7G7qePADjuDix8eek=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028