UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VntkU1HUWxZqbSGDrQMPJRYSZ3b4pMyu5EQPtrX4iVQ='
WHERE
key_id = 'af5110af9773b11c9a48bd1c3e86a93047fd539aa2005aaa9a7e486165b4e661'
AND (
token = 'VntkU1HUWxZqbSGDrQMPJRYSZ3b4pMyu5EQPtrX4iVQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)