UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6OOID+GRVV98wwt0OCoPhkzQs/wSOv0JoEeRnU2xfug=' 
WHERE 
  key_id = '7ea33d1aefb3e7948869777f1659a8d33d8269841f3aa0915720b38db51525ea' 
  AND (
    token = '6OOID+GRVV98wwt0OCoPhkzQs/wSOv0JoEeRnU2xfug=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017