UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KHifL4nfiIoZBZQ/cZBc4hUiVtdr+l19DezHU9kABis='
WHERE
key_id = '975efd7a689b255bab03cc4b205357c37f7d10eba45ea21840b590b04db98108'
AND (
token = 'KHifL4nfiIoZBZQ/cZBc4hUiVtdr+l19DezHU9kABis='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)