UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bmFFbYCXWOTEEcpTAHfu+dsWzMVPygksJYuLCRUBDmw=' 
WHERE 
  key_id = '91f03b0ce640d510bf737fec040cfb0d3fb0e994d15b7688df290901c0b92d8f' 
  AND (
    token = 'bmFFbYCXWOTEEcpTAHfu+dsWzMVPygksJYuLCRUBDmw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031