UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'neEpLN46mT5L3QHMUqLgVs9XW/Mqaro3ckWJ/IQRwl8='
WHERE
key_id = '82c99364ebf2f05879fd829557402fb8aa6568c0aabef5ced8d3993edacadf1c'
AND (
token = 'neEpLN46mT5L3QHMUqLgVs9XW/Mqaro3ckWJ/IQRwl8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)