UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/qD62KYjq48xfA1/q1/mPR6RUsm+b3ZONRx+W6RvSz4='
WHERE
key_id = 'd76954b0022606f6ab5abc9b1092314699411a196123df185d47247c982eb4e2'
AND (
token = '/qD62KYjq48xfA1/q1/mPR6RUsm+b3ZONRx+W6RvSz4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)