UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/OWK9tks2AU7BzEpfchbRhfCP3og/ywuNQBz6+H5Blg='
WHERE
key_id = '8626f8a6a245d5645bf9ef1b094e3c73f3d84d84f081cf9679bdcb05394170c5'
AND (
token = '/OWK9tks2AU7BzEpfchbRhfCP3og/ywuNQBz6+H5Blg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)