UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XUffmq0vRjmfIhIGxJCk7400RW4tVccqqlNZ6HilODA='
WHERE
key_id = '613b4738110a5605f10040f5f8e634cc8503e6e6eb72fa73566557b0558a8786'
AND (
token = 'XUffmq0vRjmfIhIGxJCk7400RW4tVccqqlNZ6HilODA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)