UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Sz7oCS036DUtSKHrTnsY6UN02/ao18B/OnzHeyxmXkg=' 
WHERE 
  key_id = 'aae51942b05b058dc41de15417d9e493523c0b789fee022b2368200433c961e2' 
  AND (
    token = 'Sz7oCS036DUtSKHrTnsY6UN02/ao18B/OnzHeyxmXkg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028