UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aSkQk6YFO484dH/yrDkSvnws1aAA3ZiUKdr4Leb/eSk='
WHERE
key_id = '8aa0c3430a497d29074a522d92110c917480dcf9d4237e54ab4ed558141c0d9f'
AND (
token = 'aSkQk6YFO484dH/yrDkSvnws1aAA3ZiUKdr4Leb/eSk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)