UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6kA/AKR9mjCW1pi+uIcb9ZVq7pGL0otvPlCOxzbcCGs=' 
WHERE 
  key_id = 'ce29ea0595058ebbbd62eb1e1a0f46d3424c6ef5c154c92e03afef961400826a' 
  AND (
    token = '6kA/AKR9mjCW1pi+uIcb9ZVq7pGL0otvPlCOxzbcCGs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044