UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '023MkHeiOHCO6XdUaj/cApF0QmATYyYs2fInOo1aXPk=' 
WHERE 
  key_id = '0df714d3efd9c33e4e3e77f7903c93975439c563d01f3b731384aea9ec0100cc' 
  AND (
    token = '023MkHeiOHCO6XdUaj/cApF0QmATYyYs2fInOo1aXPk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028