UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gxTqqHK3m+b9x6FVrbpLotpPPLwXRHBmI7ZMS515/WI='
WHERE
key_id = '4c0b1d4034351ea6f43521d62dac2554d611c4a1133a0a3e23ae02e81b066a80'
AND (
token = 'gxTqqHK3m+b9x6FVrbpLotpPPLwXRHBmI7ZMS515/WI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)