UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/s5cl/kgrahznYFfnXwe6E1DBSsX2ZtsiayUSL29nMI='
WHERE
key_id = 'ca1f69a8fe702e3a7751d20984a4a16d87134bbc7325f1cb4279fcde00ddecc8'
AND (
token = '/s5cl/kgrahznYFfnXwe6E1DBSsX2ZtsiayUSL29nMI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)