UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nTdnB9Cwk1Tj8AKzckJm39MZXskNPa+n7vcFGicE+Yk='
WHERE
key_id = '91fdb2d9e3a3ec2cf7ba04fb7aeb47fe0891046b044bc59a9e8c19bfda6dc622'
AND (
token = 'nTdnB9Cwk1Tj8AKzckJm39MZXskNPa+n7vcFGicE+Yk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)