UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'd0DXBsDKRkle3H7elFLezI/bbLOQIE6oje+AdmpGTpY='
WHERE
key_id = '405debac003b9ad7fa8c3cd86fbdf1242fa55532ccc6c051cbf5373e402ebc8d'
AND (
token = 'd0DXBsDKRkle3H7elFLezI/bbLOQIE6oje+AdmpGTpY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)