UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1ELDV9U6lVDuqZG1Ar/ZPbeQ6SEh9gMsHR4Y3Z9OAPI='
WHERE
key_id = '2f82ae1e0aaf3fb4092c84f5a673a520ab6c2ad6d3da2a6d81fa798b85fcd15e'
AND (
token = '1ELDV9U6lVDuqZG1Ar/ZPbeQ6SEh9gMsHR4Y3Z9OAPI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)