UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5cNnS5H549pnjrZoEDewZsIYRze9uBM29G6xvq5ljXs='
WHERE
key_id = '7d6910cf8c5927d727a3b59c3eddaf76c947c36cc76da0ac49b85f296febfe11'
AND (
token = '5cNnS5H549pnjrZoEDewZsIYRze9uBM29G6xvq5ljXs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)