UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hab2BeRf2Nmg72OHBiYkDFHBsnDjCJIa8cvV4GjilbQ='
WHERE
key_id = '71ff740aea368fc02b2433be0ddf67ab65e1b39b6ffa335d9efc06e7309325de'
AND (
token = 'hab2BeRf2Nmg72OHBiYkDFHBsnDjCJIa8cvV4GjilbQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)