UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1Fb0mwqJjhXYo8O6Ol2bNZ38dk9hYyvqxFLgaV187so='
WHERE
key_id = 'c51383698a94ed662fb47844ded34d7f857d17c9b66bbb659dc0a42950451c17'
AND (
token = '1Fb0mwqJjhXYo8O6Ol2bNZ38dk9hYyvqxFLgaV187so='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)