UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cBH8Wgl+T5hyKKDfYwQ/4HTWnLhlipy8Ek1//7xHviU='
WHERE
key_id = '8cc2af1216885aec575633e0139fd62b9e0dedb320940ed151b8751c58f78f9b'
AND (
token = 'cBH8Wgl+T5hyKKDfYwQ/4HTWnLhlipy8Ek1//7xHviU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)