UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Nwayh09MAQHGDyN5sqZNUcWMbUUe4/gqRTE6bWOFZ8Q=' 
WHERE 
  key_id = '2b33cf11d5f9aa920ed74a4d87db2f90e253f04b9035413543c8550261d2fbc5' 
  AND (
    token = 'Nwayh09MAQHGDyN5sqZNUcWMbUUe4/gqRTE6bWOFZ8Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020