UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dyLA8lep+2BgpdxGOLhF5hhzoobrN8jAJrD7H9PwAvY='
WHERE
key_id = '98b58a3c9738ec839ed743c3948d4d45605053a3b7b627d64ae2a24c75bf0db4'
AND (
token = 'dyLA8lep+2BgpdxGOLhF5hhzoobrN8jAJrD7H9PwAvY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)