UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Kkt0oUwWDYf7VoZU99ieP5RT6XCYKNt7A9QCtHM60Oc=' 
WHERE 
  key_id = '3805300212fee6ad561c3f709279f0b747c474800bb16d64831073926077b00c' 
  AND (
    token = 'Kkt0oUwWDYf7VoZU99ieP5RT6XCYKNt7A9QCtHM60Oc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025