UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1+rx/S8zLD9fv0Xp+ZjxgFznyfEB8IHV2u+rxU16mG4=' 
WHERE 
  key_id = 'aba3357792e811c50194712c92bd5eea329e71ed432bc9228fd89c6b66342dcb' 
  AND (
    token = '1+rx/S8zLD9fv0Xp+ZjxgFznyfEB8IHV2u+rxU16mG4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025