UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Cy7gQ+Y+ObASxX0KAupEUAu07wuUYP7sXwDBOIPwBEU='
WHERE
key_id = '879c7318bf32398f797e15c63dfcbd288f927ca35e404b4911328c9e4e592020'
AND (
token = 'Cy7gQ+Y+ObASxX0KAupEUAu07wuUYP7sXwDBOIPwBEU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)