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