UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/RndzxWlsqox5POve75vRHAHIWYtrLZqWOnFeio4KY0=' 
WHERE 
  key_id = '7f48c9cd9932564ab2a7512c4370511b99854a4a9930cf9b2d9a1797bccb7900' 
  AND (
    token = '/RndzxWlsqox5POve75vRHAHIWYtrLZqWOnFeio4KY0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031