UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4QXuOWDtvWl4ScMWJub/zNPN0ZuFK9TkV6a19PnZYJ0='
WHERE
key_id = '4c24e2d61d3365f577207fe704d51cdf64d9f0a0da85292f881fb1fa6a16c707'
AND (
token = '4QXuOWDtvWl4ScMWJub/zNPN0ZuFK9TkV6a19PnZYJ0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)