UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'naAFiYWvCqaGUIFV9dXeyloz+daAwDpReFqsnMsxUjo='
WHERE
key_id = '8a581cd87aae436cd8ccf4a0e314e8c00ae9075054bd755cc484477f77102a5e'
AND (
token = 'naAFiYWvCqaGUIFV9dXeyloz+daAwDpReFqsnMsxUjo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)