UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v1HfGXNaBAVhlmhsY8gNErOB7stpxq2JTHKJw03cRFs='
WHERE
key_id = 'c55a899d48c9d53de3e1f3a18706817635e4d2c15bbd86a37e93a938c3d5199e'
AND (
token = 'v1HfGXNaBAVhlmhsY8gNErOB7stpxq2JTHKJw03cRFs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)