UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3rxBEpt8HH/StkukTizBRHOzctUPsopc8YlvirbDykI=' 
WHERE 
  key_id = 'c99b1b5c1563b1e3a9015f3990bfdbedabb4fc34e14e803e944906ae3b8026b7' 
  AND (
    token = '3rxBEpt8HH/StkukTizBRHOzctUPsopc8YlvirbDykI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028