UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Mrudg1cxMnfFs9BrLqD6qX37qXhA+5OhHvpy6LkrpMU='
WHERE
key_id = 'af4e752c4e7d027d44399ba210db9c3b5ef4ea6ea41f4121cb378a99f85fdca6'
AND (
token = 'Mrudg1cxMnfFs9BrLqD6qX37qXhA+5OhHvpy6LkrpMU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)