UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wZVtVZ3B/DI5dgGpXqEX1sho2UEeApF3rsYvJn+MJ6g=' 
WHERE 
  key_id = '92ace71a0b9bee883aba1589e6dca311fc3397e375fad624c308c6df3866221d' 
  AND (
    token = 'wZVtVZ3B/DI5dgGpXqEX1sho2UEeApF3rsYvJn+MJ6g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043