UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1fkYNOHnliaRy1SQwuPPlHM5yPVdVLLaTZUgv/C/W88='
WHERE
key_id = '0a78a7cec445d4bca708aa098f449c7fc688b901f9a478cd3be907e14955cc32'
AND (
token = '1fkYNOHnliaRy1SQwuPPlHM5yPVdVLLaTZUgv/C/W88='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)