UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/DdtGRaAWMbHUyY4A0mce7UgZD5XpnGIcOE7D7/SFb0='
WHERE
key_id = '54234d0761ba60718bf1eaf2f2f487a7bec1e19aa0a3291d54d4e8aa4ad1eb2f'
AND (
token = '/DdtGRaAWMbHUyY4A0mce7UgZD5XpnGIcOE7D7/SFb0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)