UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VuXGh6y9izVWevSkbc8qKRUKAzrAMfbWOoohswxtoTY='
WHERE
key_id = '502df545afa9c77b96326092727e5eecdf78301f4cd5d6cace841d9aae0cc603'
AND (
token = 'VuXGh6y9izVWevSkbc8qKRUKAzrAMfbWOoohswxtoTY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)