UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8eQp0262r7H5xFie8QnTcyM4g6vs+IxY7LWy0gCVyh8='
WHERE
key_id = 'c72aeb41c806aa01c9cea66a6b61dd577d9da3fc709b2959db4870e964280f89'
AND (
token = '8eQp0262r7H5xFie8QnTcyM4g6vs+IxY7LWy0gCVyh8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)