UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nF5mycWD28yuVJcy7UHvam5uEuzl/bI9qjCJtep/rJ4='
WHERE
key_id = '9305a00131db0e5c4d17837b4b6a243e62cecec34468f1a9f2d7b779e4839a33'
AND (
token = 'nF5mycWD28yuVJcy7UHvam5uEuzl/bI9qjCJtep/rJ4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)