UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/c1OX5EqNXHm5h8U5w8cbi3NG8AioFd8dn8ldXIv5t0='
WHERE
key_id = '8f6c61c807971d91923aae8901fa77978c6f75ae76cd282a164aa44cb439db7e'
AND (
token = '/c1OX5EqNXHm5h8U5w8cbi3NG8AioFd8dn8ldXIv5t0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)