UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VuIdGazqzTof90zFomK7dM03mJ3FhIwMJZ+jdw6QoZY='
WHERE
key_id = 'ae5617b9599365b9eaa4eee105625d1f569c1effd634b03ee7a054247a7c8053'
AND (
token = 'VuIdGazqzTof90zFomK7dM03mJ3FhIwMJZ+jdw6QoZY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)