UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QP0K/nwdHSjWX0SQz9Ipjw2cfE5QMHltI21qxaMOjOU='
WHERE
key_id = '2ef56c2ccc882e9ac948d3eaee6917905eaebebfa2bce5850c68803b618828f5'
AND (
token = 'QP0K/nwdHSjWX0SQz9Ipjw2cfE5QMHltI21qxaMOjOU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)