UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gOCy3kuDL1ws2TA1fjPlVi4QsM4nKzbJ+ctCSVrYYOs='
WHERE
key_id = '370064ddfc8f1f444a2194ade1dc29ffc6c6e2a8a724f4a3790ae17f7d767c8c'
AND (
token = 'gOCy3kuDL1ws2TA1fjPlVi4QsM4nKzbJ+ctCSVrYYOs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)