UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JHdZslxjut2KBTPU5q5QWXMQNqlHjf4yZ5EdOECbzqs=' 
WHERE 
  key_id = '9df4d1f19b9f9cdfe253eed4d5d7c6043acc395fd42908a6636820e38637fe9b' 
  AND (
    token = 'JHdZslxjut2KBTPU5q5QWXMQNqlHjf4yZ5EdOECbzqs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032