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