UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jWp9xN5Be/Ng05Q3Jzpvwell3j2262iLjz6y9EpfF/M='
WHERE
key_id = 'b68df87ceac8e0d70439755dbce1661abb3357d101d99a9e2eec1e288a34253d'
AND (
token = 'jWp9xN5Be/Ng05Q3Jzpvwell3j2262iLjz6y9EpfF/M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)