UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jg4zva79N+EFFvJILO40NJCCBslCVzC71RYCNXvudvE='
WHERE
key_id = '5482daccfb472c49e39420393bb7bb516d796d128d2baa3a5ab2fb4b30a82e70'
AND (
token = 'jg4zva79N+EFFvJILO40NJCCBslCVzC71RYCNXvudvE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)