UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WlwCJaHhNxUSCW54ynjeQjpi3gXBqp03qBXCoG0PQbc='
WHERE
key_id = 'dfd28c954bb69702108d0b9c20a71033b0505e7ff275f809cfb67c4e07bebf1e'
AND (
token = 'WlwCJaHhNxUSCW54ynjeQjpi3gXBqp03qBXCoG0PQbc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)